home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / videoutils / a-g / ami2d / macros / genregion.rexx < prev    next >
OS/2 REXX Batch file  |  1978-11-24  |  1KB  |  61 lines

  1. /* script to generate region of nodes between two existing sets of nodes */
  2. options results
  3.  
  4. address ami2d
  5.  
  6. if ~show('l', "rexxmathlib.library") then do
  7.     check = addlib('rexxmathlib.library',0,-30,0)
  8. end
  9.  
  10. do n=1 to 4
  11.     'info(node)'
  12.     fn = result
  13.     parse var fn nd in junk
  14.     if in = 0 then exit
  15.     do m=1 to n-1
  16.         if in < i.m then do
  17.             do j=n-1 to m by -1
  18.                 j1 = j+1
  19.                 f.j1 = f.j
  20.                 i.j1 = i.j
  21.             end
  22.             leave
  23.         end
  24.     end
  25.     f.m = fn
  26.     i.m = in
  27. end
  28. parse var f.1 nd i1a x1a y1a
  29. parse var f.2 nd i1b x1b y1b
  30. parse var f.3 nd i2a x2a y2a
  31. parse var f.4 nd i2b x2b y2b
  32.  
  33. in = i1b - i1a
  34. jn = (i2a - i1a)/(in + 1)
  35.  
  36. ni = in
  37. 'get jnodes'
  38. if length(result) > 0 then nj = result%1 - 1
  39. else nj = jn
  40. 'set jnodes 'nj + 1
  41. 'get jgrad'
  42. if length(result) > 0 then gj = result
  43. else gj = 1
  44.  
  45. do i=0 to ni
  46.     n1 = i1a + i
  47.     n2 = i2a + i
  48.     'info(node,'0 - n1')'
  49.     parse var result nd id xa ya
  50.     'info(node,'0 - n2')'
  51.     parse var result nd id xb yb
  52.     do j=0 to nj
  53.         n = n1 + j*(ni + 1)
  54.         xn = xa + (xb-xa)*pow(j/nj,gj)
  55.         yn = ya + (yb-ya)*pow(j/nj,gj)
  56.         'node('n','xn','yn')'
  57.     end
  58. end
  59.  
  60. exit
  61.